home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Alles Voor Internet / Tout Pour Internet
/
alles voor internet.iso
/
MacInternet™
/
Telnet
/
NCSA
/
tn3270 2.3d26 source
/
tn3270
/
globals.c
< prev
next >
Wrap
Text File
|
1991-06-03
|
10KB
|
268 lines
/*
* tn3270 for the Macintosh Source Code
* Brown University Computing and Information Services
* Version 2.3d21, January 17, 1991
* Copyright (c) 1988, 1989, 1990, 1991 by Brown University and by
* Peter John DiCamillo.
*
* Permission is granted to any individual or institution to use, copy,
* or redistribute the binary version of this software and its
* documentation provided this notice and the copyright notices are
* retained. Permission is granted to any individual or non-profit
* institution to use, copy, modify, or redistribute the source files
* of this software provided this notice and the copyright notices are
* retained. This software may not be distributed for profit, either
* in original form or in derivative works, nor can the source be
* distributed to other than an individual or a non-profit institution.
* Any individual or group interested in seeing and/or using these
* source files but who are prevented from doing so by the above
* constraints should contact Don Wolfe, Assistant Vice-President for
* Computer Systems at Brown University, (401) 863-7250, for possible
* software licensing of the source developed at Brown.
*
* Brown University and Peter John DiCamillo make no representations
* about the suitability of this software for any purpose.
*
* BROWN UNIVERSITY AND PETER JOHN DICAMILLO GIVE NO WARRANTY, EITHER
* EXPRESS OR IMPLIED, FOR THE PROGRAM AND/OR DOCUMENTATION PROVIDED,
* INCLUDING, WITHOUT LIMITATION, WARRANTY OF MERCHANTABILITY AND
* WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE.
*
*/
#include "maclib.h"
#include "termdef.h"
char done; /* flag for mainline to return */
char connflg; /* flag for initial connect mode */
char netconn; /* flag for current AppleTalk session */
unsigned char * readbuff; /* transmitted diag data */
short rbsize; /* number of bytes in readbuff */
short rballoc; /* allocated size of readbuff */
struct Rect screenRect, dragRect, pRect, sizeRect;
struct WindowRecord wRecord;
struct GrafPort *myWindow;
char **myMenus[NMENUS];
char ** kybdMenu;
char ** nlMenu;
GrafPort WritePort;
GrafPtr WritePtr;
char * mapptr;
GrafPort PictPort;
GrafPtr PictPtr;
char * pmapptr;
char drawpict;
char newpict;
struct WindowRecord * whichWindow;
struct EventRecord myEvent;
struct Cursor **grafcursor;
char dfltcurs;
char kblock, kblcode, aplmode, insmode, online;
short ldvoff;
char ptfill;
unsigned char * chrbuff;
unsigned short * atrbuff;
scrapline * scrapstart;
short scrapalloc, scrapsize, scrapwidth;
short curadr;
short bufadr;
short chratr;
unsigned char lastwcc;
char fmtscrn;
short WriteCurr;
unsigned char rdaid = 0x60;
struct Rect er;
short x,y;
struct Rect inrect = {32767, 32767, -32767, -32767};
short in_len = 0;
short in_off, in_atr;
kbdata kbqueue[KBQMAX]; /* keyboard input queue */
short kbqsize;
unsigned char dfltmap[7] = {0x00, 0x40, 0x80, 0x20,
0x30, 0x10, 0x80};
char addr14; /* generate 14-bit addresses for this session */
char serflg; /* 0 = AppleTalk; 1 = async */
char tcpflg; /* 0 = PC Net; 1 = TCP/IP */
char dfltsflg; /* default connection for commdlg */
char apiopen; /* true if current session opened by API */
/* API data when apiopen is true: */
char apiopenpend; /* api open response not sent yet */
unsigned char *apihostname; /* host name for API session */
unsigned char *apiwindowname; /* window name for API session */
OpenRequest apiopenreq; /* API open request data */
short apiopenrefnum; /* SPPC client refnum for open */
unsigned long apiopensref; /* PPC session refnum for open */
char apiopenkind; /* 0 = PPC, 1 = SPPC */
unsigned long apiopenmsgid; /* SPPC/PPC message id of open request */
char apiclosenotify; /* true if close notification wanted */
short apicloserefnum; /* SPPC client refnum for notify */
unsigned long apiclosesref; /* PPC session refnum for close */
char apiclosekind; /* 0 = PPC, 1 = SPPC */
unsigned long apiclosemsgid; /* SPPC/PPC message id of notify request */
char apiwritenotify; /* true if write notification wanted */
short apiwriterefnum; /* SPPC client refnum for notify */
unsigned long apiwritesref; /* PPC session refnum for write */
char apiwritekind; /* 0 = PPC, 1 = SPPC */
unsigned long apiwritemsgid; /* SPPC/PPC message id of notify request */
unsigned char apikberr; /* error code for API input processing */
/* current settings, intialized to defaults */
char cshostname[128] = "";
char cskybdname[256] = "default";
char csnlname[256]; /* initialized at startup from first menu item */
char cssndname[256]; /* initialized at startup from dfltsoundname */
settings_list cs = {
{0x00, 0x40, /* attributes */
0x80, 0x20,
0x30, 0x10,
0x80},
0, /* dblevel */
/* setsflg */
#ifdef ASYNC
1,
#else
#ifdef TCP
2,
#else
0,
#endif
#endif
1, /* timeout */
15, /* retries */
1, /* insreset */
1, /* impnull */
1, /* digitpfk */
23, /* mousepf */
0, /* basecolor */
1, /* exactcolor */
DFLTWHITE, /* usrwhite */
DFLTYELLOW, /* usryellow */
DFLTPINK, /* usrpink */
DFLTTURQUOISE, /* usrturquoise */
DFLTGREEN, /* usrgreen */
DFLTRED, /* usrred */
DFLTBLUE, /* usrblue */
DFLTBLACK, /* usrblack */
DFLTBACK, /* usrback */
DFLTBLUE, /* usrstat */
12, /* dfltptsize */
12, /* altptsize */
24, /* altrows */
80, /* altcols */
24, /* custrows */
80, /* custcols */
0, /* windpth */
0, /* windptv */
0, /* invertbw */
1, /* stat_time */
0, /* curpos */
0, /* blockcurs */
1, /* ext3270 */
1, /* std_brack */
0, /* windmax */
1, /* repnull */
1, /* savewpos */
1, /* autoconn */
'ttxt', /* text_creator */
0, /* simps */
0 /* unused */
};
/* settings to/from file */
char *fshostname;
char *fskybdname;
char *fsnlname;
char *fssndname;
settings_list fs;
char s_fName[64] = ""; /* last filename used */
char logon; /* user logged-in to server */
char specuser = 0; /* user with special privileges */
char ScrDmpSav; /* saved ScrDmpEnb byte */
char sw_bgrnd; /* running in switcher background */
char sw_upd; /* update occurred in background */
char sw_beep; /* beep occurred in background */
short ioerror; /* terminal I/O error code */
long at_last; /* time of last AppleTalk I/O */
unsigned char nlstdata; /* last type of data write */
unsigned char nlstopcd; /* last write op-code */
char ewamode; /* logical erase/write state: 0 = default, 1 = alt. */
Point mousehit; /* last hit in dialog box */
char int_active; /* interrupt routine running */
char pndbig; /* pending big data */
char pndbeep; /* pending bell */
char pndinv; /* pending invldscr */
char pndclr; /* pending clrpict */
char pndnewmode; /* pending newmode */
char pndmode; /* mode for pending newmode */
char needwrite; /* call to writescr needed */
char kb_err; /* kb entry error code */
char wr_active; /* statline write active flag */
char colormac; /* true if we have color QuickDraw */
char newroms; /* Mac has 128K ROMs or newer */
unsigned char syslevel; /* level of system software (1st digit) */
char zoomok; /* true if window can be zoomed */
char mf_bgrnd; /* in background under MultiFinder */
short ses_altrows; /* EWA rows for this session */
short ses_altcols; /* EWA columns for this session */
short ses_altptsize; /* EWA point size for this session */
short ses_dfltptsize; /* default point size for this session */
char ses_windmax; /* max. window size flag for this session */
short cur_rows; /* row count for current display */
short cur_cols; /* column count for current display */
short cur_ptsize; /* point size for current display */
char cur_mode; /* current display mode: 0 = normal, 1 = alt. */
char ftpcopen; /* FTP control connection open */
char ftpdopen; /* FTP data connection open */
char ftplopen; /* FTP list connection open */
char fixbracket; /* don't use GE with [, ] */
char wtitle[256]; /* title for our window */
char savepict; /* save graphics in PICT file */
Handle xtabh; /* handle to EBCDIC to Mac ASCII xtab */
THPrint hPrint; /* print record handle */
char prtinit; /* flag for printing intialization */
char textsel; /* text selected for cut/copy/clear */
unsigned char **kb_handle; /* handle to current keyboard mapping */
unsigned char **nl_handle; /* handle to current language mapping */
short rowmax9; /* maximum no. of rows for 9-point font */
short colmax9; /* maximum no. of columns for 9-pt. font */
short rowmax12; /* maximum no. of rows for 12-point font */
short colmax12; /* maximum no. of columns for 12-pt. font */
unsigned char nltab[256]; /* national language translation table */
short stdfont; /* no. of standard font (add 2 for bold) */
char textmap; /* flag for presence of text bitmap */
char plainala; /* if true, suppress ALA overstrikes */
Handle sndhandle; /* handle to 'snd ' resource for beep */
char sndactive; /* true while sound is being played */
SndChannelPtr scp; /* pointer for async sound channel */
/* name for default sound */
unsigned char dfltsoundname[] = "System Alert Sound";
char wposok; /* true if saved window position is valid */
OSType text_creator; /* creator for text files */
char smgr_sppc; /* true if session manger registered ok */
char sess_sppc; /* true if session registered ok */
short smgrrefnum; /* session manager SPPC refnum */
short sessrefnum; /* session SPPC refnum */
char gestaltavail; /* Gestalt is available */
char ppcavail; /* PPC is available */
unsigned long ppcflags; /* PPC flags from Gestalt */
char smgrppc; /* true if session mananger opened a port */
char sessppc; /* true if session opened a port */
short smgrpref; /* port refnum for session manager */
short sesspref; /* port refnum for session */
queueinfo paramqueue; /* PPC param block queue */
queueinfo clientqueue; /* PPC client record queue */
queueinfo dataqueue; /* PPC data block queue */
RgnHandle cliprgn; /* regions for grow icon handling */
RgnHandle destrgn;
RgnHandle temprgn;
/* unsigned long ticktime; !!!!! elapsed time in tick count */